package com.zhangtai.modules.service.common;


import com.zhangtai.modules.entity.common.ContractUrlEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-06-02 15:30:35
 */

public interface ContractUrlService {

    @GetMapping("/findContractUrlList")
    PageResult queryPage(@RequestParam(value = "name", required = false) String name,
                         @RequestParam(value = "blurName", required = false) String blurName,
                         @RequestParam(value = "idCard", required = false) String idCard,
                         @RequestParam(value = "contractName", required = false) String contractName,
                         @RequestParam(value = "signedTimeStart", required = false) String signedTimeStart,
                         @RequestParam(value = "signedTimeStart", required = false) String signedTimeEnd,
                         @RequestParam(value = "type", required = false) String type,
                         @RequestParam(value = "status", required = false) String status,
                         @RequestParam(value = "expiredStartTime",  required = false) String expiredStartTime,
                         @RequestParam(value = "expiredEndTime",  required = false) String expiredEndTime,
                         @RequestParam(value = "orgIds",  required = false) List<Long> orgIds,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult getPersonContractList(@RequestParam(value = "oid") Long oid,
                                     @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);


    @GetMapping("/infoContractUrl")
    ContractUrlEntity getByIdE(@RequestParam("id") Long id);

    List<ContractUrlEntity> getContractUrlEntityListByIdCardAndStatus(@RequestParam("id") String id);

    @GetMapping("/infoContractUrlByIdCard")
    List<ContractUrlEntity> getByIdCard(@RequestParam("id") String id);

    @PostMapping("/saveContractUrl")
    R saveE(@RequestBody ContractUrlEntity entity);

    @PostMapping("/updateContractUrl")
    R updateByIdE(@RequestBody ContractUrlEntity entity);

    @GetMapping("/deleteOneContractUrl")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteContractUrls")
    R removeByIdsE(@RequestBody List<Long> ids);

    @PostMapping("/saveContractUrlVo")
    R saveContractUrl(@RequestBody ContractUrlEntity contractUrlEntity) throws Exception;

    @GetMapping("/findByFlowId")
    R<List<ContractUrlEntity>> findByFlowId(@RequestParam("flowId") Integer flowId);

    @PostMapping("/updateByFlowId")
    R uploadToOssAndUpdate(@RequestBody ContractUrlEntity contractUrlEntity) throws Exception;


}

